/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.entidad;

import java.io.Serializable;
import java.math.BigDecimal;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Abner Bastarrachea
 */
@Entity
@Table(name = "article")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Article.findAll", query = "SELECT a FROM Article a"),
    @NamedQuery(name = "Article.findByPkArticle", query = "SELECT a FROM Article a WHERE a.pkArticle = :pkArticle"),
    @NamedQuery(name = "Article.findByFkTypeArticle", query = "SELECT a FROM Article a WHERE a.fkTypeArticle = :fkTypeArticle"),
    @NamedQuery(name = "Article.findByDescription", query = "SELECT a FROM Article a WHERE a.description = :description"),
    @NamedQuery(name = "Article.findByPrice", query = "SELECT a FROM Article a WHERE a.price = :price"),
    @NamedQuery(name = "Article.findByStatusRegister", query = "SELECT a FROM Article a WHERE a.statusRegister = :statusRegister")})
public class Article implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "pkArticle")
    private Integer pkArticle;
    @Basic(optional = false)
    @Column(name = "fkTypeArticle")
    private short fkTypeArticle;
    @Basic(optional = false)
    @Column(name = "description")
    private String description;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Basic(optional = false)
    @Column(name = "price")
    private BigDecimal price;
    @Basic(optional = false)
    @Column(name = "statusRegister")
    private short statusRegister;

    public Article() {
    }

    public Article(Integer pkArticle) {
        this.pkArticle = pkArticle;
    }

    public Article(Integer pkArticle, short fkTypeArticle, String description, BigDecimal price, short statusRegister) {
        this.pkArticle = pkArticle;
        this.fkTypeArticle = fkTypeArticle;
        this.description = description;
        this.price = price;
        this.statusRegister = statusRegister;
    }

    public Integer getPkArticle() {
        return pkArticle;
    }

    public void setPkArticle(Integer pkArticle) {
        this.pkArticle = pkArticle;
    }

    public short getFkTypeArticle() {
        return fkTypeArticle;
    }

    public void setFkTypeArticle(short fkTypeArticle) {
        this.fkTypeArticle = fkTypeArticle;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public BigDecimal getPrice() {
        return price;
    }

    public void setPrice(BigDecimal price) {
        this.price = price;
    }

    public short getStatusRegister() {
        return statusRegister;
    }

    public void setStatusRegister(short statusRegister) {
        this.statusRegister = statusRegister;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (pkArticle != null ? pkArticle.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Article)) {
            return false;
        }
        Article other = (Article) object;
        if ((this.pkArticle == null && other.pkArticle != null) || (this.pkArticle != null && !this.pkArticle.equals(other.pkArticle))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.entidad.Article[ pkArticle=" + pkArticle + " ]";
    }
    
}
